package cn.shop.transcation.order.entity;

import cn.shop.utils.enums.OrderStatus;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author : 李一涵
 * @date : Created in 2022/5/23 10:12
 * @description : 购物车
 */
@Data
@ToString
public class Cart {

    /** 编号 */
    private Long id;
    /** 用户编号 */
    private Long userId;
    /** 分区编号 */
    private Long partitionId;
    /** 订单编号 */
    private Long orderId;
    /** 商品名 */
    private String goods;
    /** 商品数量 */
    private Long goodsNum;
    /** 金额 */
    private BigDecimal amount;
    /**
     * 创建人
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField(fill = FieldFill.INSERT)
    private Long createId;

    /**
     * 创建时间
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE, select = false)
    private Long updateId;

    /**
     * 更新时间
     */
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE, select = false)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private String game;
    @TableField(exist = false)
    private String partitionName;
    @TableField(exist = false)
    private String alias;
    @TableField(exist = false)
    private OrderStatus status;

}
